authorization do
  role :guest do
  end

  role :administration_r do
    has_permission_on :admin_admin, :to => :read
  end

  role :templates_m do
    has_permission_on :admin_templates, :to => :manage
  end

  role :versions_m do
    has_permission_on :admin_versions, :to => :manage
  end

  role :contents_m do
    has_permission_on :admin_contents, :to => :manage
  end

  role :user_infos_m do
    has_permission_on :admin_user_infos, :to => :manage
  end

  role :settings_m do
    has_permission_on :admin_settings, :to => :manage
  end

  role :products_m do
    has_permission_on :admin_products, :to => :manage
  end

  role :orders_m do
    has_permission_on :admin_orders, :to => :manage
  end

  role :email_templates do
    has_permission_on :admin_email_templates, :to => :manage
  end

  role :amount_types do
    has_permission_on :admin_amount_types, :to => :manage
  end

  role :metrics do
    has_permission_on :admin_metrics, :to => :manage
  end

  role :tax_categories do
    has_permission_on :admin_tax_categories, :to => :manage
  end

  role :administrators do
    has_permission_on :admin_administrators, :to => :manage
  end

  role :categories do
    has_permission_on :admin_categories, :to => :manage
  end

  role :category_groups do
    has_permission_on :admin_category_groups, :to => :manage
  end

  role :roles do
    has_permission_on :admin_roles, :to => :manage
  end

  role :shipping_methods do
    has_permission_on :admin_shipping_methods, :to => :manage
  end

  role :billing_methods do
    has_permission_on :admin_billing_methods, :to => :manage
  end

  role :variants do
    has_permission_on :admin_variants, :to => :manage
  end

  role :product_parameters do
    has_permission_on :admin_product_parameters, :to => :manage
  end

  role :parameters do
    has_permission_on :admin_parameters, :to => :manage
  end

  role :parameter_values do
    has_permission_on :admin_parameter_values, :to => :manage
  end

  role :product_properties do
    has_permission_on :admin_product_properties, :to => :manage
  end

  role :product_supplements do
    has_permission_on :admin_product_supplements, :to => :manage
  end

  role :product_accessories do
    has_permission_on :admin_product_accessories, :to => :manage
  end

  role :product_categories do
    has_permission_on :admin_product_categories, :to => :manage
  end

  role :property_patterns do
    has_permission_on :admin_property_patterns, :to => :manage
  end

  role :product_photos do
    has_permission_on :admin_product_photos, :to => :manage
  end

  role :comments do
    has_permission_on :admin_comments, :to => :manage
  end

  role :order_user_infos do
    has_permission_on :admin_order_user_infos, :to => :manage
  end

  role :properties do
    has_permission_on :admin_properties, :to => :manage
  end
  
  role :admin do
    includes :administration_r
    includes :templates_m
    includes :versions_m
    includes :contents_m
    includes :user_infos_m
    includes :settings_m
    includes :products_m
    includes :orders_m
    includes :email_templates
    includes :amount_types
    includes :metrics
    includes :tax_categories
    includes :administrators
    includes :categories
    includes :roles
    includes :shipping_methods
    includes :billing_methods
    includes :variants
    includes :product_parameters
    includes :parameters
    includes :parameter_values
    includes :category_groups
    includes :product_properties
    includes :product_supplements
    includes :product_accessories
    includes :product_categories
    includes :product_photos
    includes :property_patterns
    includes :order_user_infos
    includes :comments
    includes :properties
  end
end

privileges do
  privilege :manage, :includes => [:create, :read, :update, :delete]
  privilege :read, :includes   => [:index, :show]
  privilege :create, :includes => :new
  privilege :update, :includes => :edit
  privilege :delete, :includes => :destroy
end